---
layout: "default"
title: "min"
description: "Swift documentation for 'min': Returns the lesser of x and y."
keywords: "min,func,swift,documentation"
root: "/v2.1"
---

<div class="declaration" id="func-min-t_-comparable_-t_-t">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-min-t_-comparable_-t_-t">func <wbr>min&lt;T : Comparable&gt;(<wbr>_:<wbr> T, _: T)</a>
        
<div class="comment collapse" id="comment-func-min-t_-comparable_-t_-t"><div class="p">
    <p>Returns the lesser of <code>x</code> and <code>y</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func min&lt;T : Comparable&gt;(x: T, _ y: T) -&gt; T</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-min-t_-comparable_-t_-t_-t_-t">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-min-t_-comparable_-t_-t_-t_-t">func <wbr>min&lt;T : Comparable&gt;(<wbr>_:<wbr> T, _:<wbr> T, _:<wbr> T, _: T...)</a>
        
<div class="comment collapse" id="comment-func-min-t_-comparable_-t_-t_-t_-t"><div class="p">
    <p>Returns the least argument passed.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func min&lt;T : Comparable&gt;(x: T, _ y: T, _ z: T, _ rest: T...) -&gt; T</code>
    
    
</div></div>
</div>
